public class JmsListenerEndpointRegistrar extends java.lang.Object implements ApplicationContextAware, InitializingBean
JmsListenerEndpoint
with
a JmsListenerEndpointRegistry
.JmsListenerConfigurer
Modifier and Type | Class and Description |
---|---|
private static class |
JmsListenerEndpointRegistrar.JmsListenerEndpointDescriptor |
Modifier and Type | Field and Description |
---|---|
private ApplicationContext |
applicationContext |
private JmsListenerContainerFactory<?> |
containerFactory |
private java.lang.String |
containerFactoryBeanName |
private java.util.List<JmsListenerEndpointRegistrar.JmsListenerEndpointDescriptor> |
endpointDescriptors |
private JmsListenerEndpointRegistry |
endpointRegistry |
private JmsHandlerMethodFactory |
jmsHandlerMethodFactory |
Constructor and Description |
---|
JmsListenerEndpointRegistrar() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
JmsListenerEndpointRegistry |
getEndpointRegistry()
Return the
JmsListenerEndpointRegistry instance for this
registrar, may be null . |
JmsHandlerMethodFactory |
getJmsHandlerMethodFactory()
Return the custom
JmsHandlerMethodFactory to use, if any. |
void |
registerEndpoint(JmsListenerEndpoint endpoint)
Register a new
JmsListenerEndpoint using the default
JmsListenerContainerFactory to create the underlying container. |
void |
registerEndpoint(JmsListenerEndpoint endpoint,
JmsListenerContainerFactory<?> factory)
Register a new
JmsListenerEndpoint alongside the
JmsListenerContainerFactory to use to create the underlying container. |
private JmsListenerContainerFactory<?> |
resolveContainerFactory(JmsListenerEndpointRegistrar.JmsListenerEndpointDescriptor descriptor) |
void |
setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.
|
void |
setContainerFactory(JmsListenerContainerFactory<?> containerFactory)
Set the
JmsListenerContainerFactory to use in case a JmsListenerEndpoint
is registered with a null container factory. |
void |
setContainerFactoryBeanName(java.lang.String containerFactoryBeanName)
Set the bean name of the
JmsListenerContainerFactory to use in
case a JmsListenerEndpoint is registered with a null
container factory. |
void |
setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry)
Set the
JmsListenerEndpointRegistry instance to use. |
void |
setJmsHandlerMethodFactory(JmsHandlerMethodFactory jmsHandlerMethodFactory)
Set the
JmsHandlerMethodFactory to use to configure the message
listener responsible to serve an endpoint detected by this processor. |
protected void |
startAllEndpoints() |
private JmsListenerEndpointRegistry endpointRegistry
private java.lang.String containerFactoryBeanName
private JmsListenerContainerFactory<?> containerFactory
private JmsHandlerMethodFactory jmsHandlerMethodFactory
private ApplicationContext applicationContext
private final java.util.List<JmsListenerEndpointRegistrar.JmsListenerEndpointDescriptor> endpointDescriptors
public void setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry)
JmsListenerEndpointRegistry
instance to use.public JmsListenerEndpointRegistry getEndpointRegistry()
JmsListenerEndpointRegistry
instance for this
registrar, may be null
.public void setContainerFactoryBeanName(java.lang.String containerFactoryBeanName)
JmsListenerContainerFactory
to use in
case a JmsListenerEndpoint
is registered with a null
container factory. Alternatively, the container factory instance can
be registered directly, see setContainerFactory(JmsListenerContainerFactory)
public void setContainerFactory(JmsListenerContainerFactory<?> containerFactory)
JmsListenerContainerFactory
to use in case a JmsListenerEndpoint
is registered with a null
container factory.
Alternatively, the bean name of the JmsListenerContainerFactory
to use
can be specified for a lazy lookup, see setContainerFactoryBeanName(java.lang.String)
.
public void setJmsHandlerMethodFactory(JmsHandlerMethodFactory jmsHandlerMethodFactory)
JmsHandlerMethodFactory
to use to configure the message
listener responsible to serve an endpoint detected by this processor.
By default, DefaultJmsHandlerMethodFactory
is used and it
can be configured further to support additional method arguments
or to customize conversion and validation support. See
DefaultJmsHandlerMethodFactory
javadoc for more details.
public JmsHandlerMethodFactory getJmsHandlerMethodFactory()
JmsHandlerMethodFactory
to use, if any.public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- the ApplicationContext object to be used by this objectBeanInitializationException
public void registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory)
JmsListenerEndpoint
alongside the
JmsListenerContainerFactory
to use to create the underlying container.
The factory
may be null
if the default factory has to be
used for that endpoint.
public void registerEndpoint(JmsListenerEndpoint endpoint)
JmsListenerEndpoint
using the default
JmsListenerContainerFactory
to create the underlying container.public void afterPropertiesSet() throws java.lang.Exception
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
java.lang.Exception
- in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails.protected void startAllEndpoints() throws java.lang.Exception
java.lang.Exception
private JmsListenerContainerFactory<?> resolveContainerFactory(JmsListenerEndpointRegistrar.JmsListenerEndpointDescriptor descriptor)